package com.bhs.sansonglogistics.ui.order;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.os.Bundle;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;

import com.amap.api.maps.MapView;
import com.bhs.sansonglogistics.R;
import com.bhs.sansonglogistics.base.BaseActivity;
import com.bhs.sansonglogistics.bean.LogisticsTrackBean;
import com.bhs.sansonglogistics.ui.adapter.LogisticsTrackAdapter;

import java.util.ArrayList;
import java.util.List;

/**
 * 物流轨迹(废弃)
 */
public class LogisticsTrackActivity extends BaseActivity {


    private FrameLayout mFlBack;
    private FrameLayout mFlShare;
    private MapView mMap;
    private TextView mBtnVehicleLocation;
    private ImageView mIvHead;
    private TextView mIvTitle;
    private TextView mTvWaybillNumber;
    private RecyclerView mRvList;
    private LogisticsTrackAdapter adapter;
    private List<LogisticsTrackBean> list=new ArrayList<>();

    @Override
    public int initLayout() {
        return R.layout.activity_logistics_track;
    }

    @Override
    public void initView() {
        mFlBack = findViewById(R.id.fl_back);
        mFlShare = findViewById(R.id.fl_share);
        mMap = findViewById(R.id.map);
        mBtnVehicleLocation = findViewById(R.id.tv_vehicle_location);
        mIvHead = findViewById(R.id.iv_head);
        mIvTitle = findViewById(R.id.iv_title);
        mTvWaybillNumber = findViewById(R.id.tv_waybill_number);
        mRvList = findViewById(R.id.rv_list);
    }

    @Override
    public void initView(@Nullable Bundle savedInstanceState) {
        super.initView(savedInstanceState);
        mMap.onCreate(savedInstanceState);
    }

    @Override
    public void initData() {
        list.add(new LogisticsTrackBean());
        list.add(new LogisticsTrackBean());
        list.add(new LogisticsTrackBean());
        adapter=new LogisticsTrackAdapter();
        mRvList.setAdapter(adapter);
        mRvList.setLayoutManager(new LinearLayoutManager(this));
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        //在activity执行onDestroy时执行mMapView.onDestroy()，销毁地图
        mMap.onDestroy();
    }

    @Override
    protected void onResume() {
        super.onResume();
        //在activity执行onResume时执行mMapView.onResume ()，重新绘制加载地图
        mMap.onResume();
    }

    @Override
    protected void onPause() {
        super.onPause();
        //在activity执行onPause时执行mMapView.onPause ()，暂停地图的绘制
        mMap.onPause();
    }
}